{include file='header.html'}
<style type="text/css">
<!--
body {
	margin-left: 5px;
	margin-top: 1px;
	margin-right: 5px;
	margin-bottom: 1px;
	background-color: #1D3647;
}
-->
</style>
<table style="border:0px;width:100%;border-collapse:collapse; border-spacing:0px;">
   <tr>
      <td valign="top" style="padding:0px;">
      <table class="login_top_bg" 
      	style="border:0px;width:100%;background-image: url(./img/login-top-bg-small.png);background-repeat: repeat-x; 
      	border-collapse:collapse; border-spacing:0px;"> <!-- cellpadding="0" cellspacing="0" width="100%" border="0px"  -->
        <tr style="padding:0px; background-image:url({$rtvdir}/img/login-top-bg-small-updown.png); background-repeat:repeat-x;">
          <td width="33%" style="padding:0px;height:27px;">
          	<a href="./" style="color:#ABCAD3;font-weight:bold;font-size:16px;font-family:Tahoma,Geneva,sans-serif;"
          		title="HomePage/首頁">
          		&nbsp;{$agentname} </a>
          </td>
          <td width="5%" style="padding:0px;"> <div id="top_notice_div" style="postion:absolute; width:400px; top:20px; left:20px; text-align:center;z-index:99"></div> </td>
          <td width="62%" style="text-align:right;padding:0px;" class="login-buttom-txt"> {$welcomemsg} </td>
        </tr>
      </table>
      </td>
    </tr>

  <tr>
    <td valign="top" style="padding:0px;">
     <table 
     	style="border:0px;width:100%;height:98%;border-collapse:collapse; border-spacing:0px;border-padding:0px;" 
     	class="login_bg"> <!-- width="100%" height="98%" border="0px" cellpadding="0" cellspacing="0"  -->
      <tr>
        <td width="98%" height="{if $isheader == 0}390px%{else}699px{/if}" align="left" style="padding:0px;">

            {$content}
			
            <div id="welcomearea" style="float:left;margin-left:28px">
			<b> &Pi; <a href="./" style="font-size:17px" >首页</a> <span style="font-size:17px">&rarr;</span></b>
			欢迎您回来！ 今天是 <a href="#-万年历" target="_blank"><script type="text/javascript" src="./comm/show_today.js"></script></a>
            <br/> 

           <style type='text/css'>
		   .wrapper{
			      position: relative;
				     float: left;
					    left: 29px;
						   /*width: 850px;*/
						      margin-bottom: 20px;
							     /*background-color: #cccccc*/
		   }
		   .left1{
			      position: relative; word-break:break-all; word-wrap:break-word;
				     float: left; vertical-align:middle;padding:5px 5px 5px 5px;
					    left: 10px;
						   width: 150px;
						      height: 70px;
							     background-color: #cfcfcf
		   }
		   .left2{
			      position: relative; word-break:break-all; word-wrap:break-word;
				     float: left;vertical-align:middle;padding:5px 5px 5px 5px;
					    left: 30px;
						   width: 150px;
						      height: 70px;
							     background-color: #cfcfcf
		   }
		   .left3{
			      position: relative; word-break:break-all; word-wrap:break-word;
				     float: left;vertical-align:middle;padding:5px 5px 5px 5px;
					    left: 50px;
						   width: 150px;
						      height: 70px;
							     background-color: #cfcfcf
		   }
		   .left4{
			      position: relative; word-break:break-all; word-wrap:break-word;
				     float: left;vertical-align:middle;padding:5px 5px 5px 5px;
					    left: 70px;
						   width: 150px;
						      height: 70px;
							     background-color: #cfcfcf
		   }
		   .wrapperlog{
			      position: relative;
				     float: left;
					    left: 39px;
						   width: 670px;
						      margin-bottom: 20px;
							     background-color: #cccccc;
					padding-left:10px;
					padding-right:20px;
		   }
		</style>
		<table style="width:700px; background:transparent; align:center">

		{if count($navidir_list)>0}
		<tr>
		<td>
		<b title="浏览菜单导航">ND.{$navidir_list[0]['linkname']} Navigate Directory</b><br/>
		{$mi=0}
		{foreach $navidir_list as $k=>$v}
			{if $k==0}
			<!-- {$k} -->
			{else}
				{if $mi==0 || ($mi) % 4 == 0}
				<div class="wrapper">
				{/if}
					 {if $navidir_list[$k]['modulename'] == ''}
					 <a href="./?navidir={$navidir_list[$k]['levelcode']}">
					 {else}
					 <a href="./{$ido}&tbl={$navidir_list[$k]['modulename']}">
					 {/if}
					 <div class="left{(($k -1) % 4)+1}">
					 	<span style="size:14px; font-weight:bold;">{$mi+1}.{$navidir_list[$k]['linkname']}</span>
					 	<br/>({$navidir_list[$k]['modulename']})</div></a>
				{if ($mi+1) % 4 == 0}
				</div>
				{/if}
				{$mi=$mi+1}
			{/if}
		{/foreach}	
		</td>
		</tr>
		{/if}
		
		<tr>
			<td colspan="10">
			<b title="(工作、任务列表)">WT.工作表 Work-Todo</b><br/>
			<div id="tododiv" class="wrapperlog">
			<table style="border:0px; background:transparent;">
				<tr style="font-weight: bold;"><td>序号</td><td>事项/任务</td><td>状态</td><td>需求方</td><td>供应方</td><td>更新时间</td></tr>
				{foreach $todo_list as $k=>$v}
				<tr>
				<td>{$v['id']}.</td>
				<td><a href="./ido.php?tbl=fin_todotbl&pnskstate={$v['state']}&tit=事项管理">{$v['taskname']}</a></td>
				<td>{$todo_state[$v['state']]}</td>
				<td>{$user_list[$v['triggerbyparentid']]['email']}</td>
				<td>{$user_list[$v['touser']]['email']}</td>
				<td>{$v['updatetime']}</td>
				</tr>
				{/foreach}
				<tr><td style="white-space:nowrap;"><a href="./ido.php?tbl=fin_todotbl&pnobstate=1&tit=事项管理&pnsktouserid={$userid}">更多...</a></td></tr>
			</table>
			</div>	
			</td>
		</tr>

		<tr>
		<td>
		<b title="(根据被调用频率自动排列、调整)">MU.常用 Most-Used</b><br/>
		{$mi=0}
		{foreach $module_list_order as $k=>$v}
			{if $mi==0 || ($mi) % 4 == 0}
			<div class="wrapper">
			{/if}
				 <a href="./{$ido}&tbl={$module_list_order[$k]}">
				 <div class="left{($k%4)+1}">
				 	<span style="size:14px; font-weight:bold;">{$mi+1}.{$module_list_name[$module_list_order[$k]]}</span>
				 	<br/>({$module_list_order[$k]})
				 </div>
				 </a>
			{if ($mi+1) % 4 == 0}
			</div>
			{/if}
			{$mi=$mi+1}
		{/foreach}
		<!--
			<div class="wrapper">
				 <div class="left1"></div>
					<div class="left2"></div>
					<div class="left3"></div>
					<div class="left4"></div>
			</div>
			-->
		</td>
		</tr><tr>
		<td>
		<b title="（用户自定义的快捷列表，在“系统设置--单元模块”中选择某个模块，修改其中“添加到桌面”即可）">DT.桌面 Desktop</b><br/>
		{$mi=0}
		{foreach $module_list_byuser as $k=>$v}
			{if $mi==0 || ($mi) % 4 == 0}
			<div class="wrapper">
			{/if}
				 <a href="./{$ido}&tbl={$v['tblname']}"><div class="left{($k%4)+1}"><span style="size:14px; font-weight:bold;">{$mi+1}.{$v['objname']}</span><br/>({$v['tblname']})</div></a>
			{if ($mi+1) % 4 == 0}
			</div>
			{/if}
			{$mi=$mi+1}
		{/foreach}
		</td>
		</tr>

		<tr>
			<td colspan="10">
			<b title="(操作、管理日志)">OL.操作日志 Operation-Log</b><br/>
			<div id="oplogdiv" class="wrapperlog">
			<pre><b>时间					用户/Id						执行操作					作用对象/Id</b>
<pre>{foreach $log_list as $k=>$v}
{$v['inserttime']}		{$v['useremail']}/{$v['userid']}		{$v['actionstr']}		{$v['parenttype']}/{$v['parentid']}
{/foreach}</pre>
			<a href="./ido.php?tbl=fin_operatelogtbl">更多...</a>
			</div>	
			</td>
		</tr>

		<tr><td colspan="10">
		<script type="text/javascript"> 
		function diffInYearsAndDays(startDate, endDate) {
			// Copy and normalise dates
			var d0 = new Date(startDate);
			d0.setHours(12,0,0,0);
			var d1 = new Date(endDate);
			d1.setHours(12,0,0,0);
			// Make d0 earlier date
			// Can remember a sign here to make -ve if swapped
			if (d0 > d1) {
				var t = d0;
				d0 = d1;
				d1 = t;
			}  
			// Initial estimate of years
			var dY = d1.getFullYear() - d0.getFullYear();
			// Modify start date
			d0.setYear(d0.getFullYear() + dY);
			// Adjust if required
			if (d0 > d1) {
				d0.setYear(d0.getFullYear() - 1);
				--dY;
			}
			// Get remaining difference in days
			var dD = (d1 - d0) / 8.64e7;
			// If sign required, deal with it here
			return [dY, dD];  
		}
		</script>
		<b><i>ii</i></b>.系统已上线 <a href="./"><script type="text/javascript">diff=diffInYearsAndDays('{$system_lastmodify}',(new Date()));document.write(''+diff[0]+' 年 '+diff[1]+' 天');</script></a> , 目前共 <b>{$user_count}</b> 位用户，管理着<b> {$module_count}  </b>个功能模块.  
		</td></tr>

		<tr><td><b><i>HM</i></b>.<a href="{$front_page}" target="_blank">打开主站</a></td></tr>
		</table>
		<!-- <script type="text/javascript">window.setTimeout(location.href='{$todourl}', 10*60*1000);</script> -->
		<br/>
            </div>
		<br/>
        </td>
      </tr>
     </table>

    </td>
  </tr>
 
</table>
{include file='footer.html'}
